package de.tutorial.gregowe;

import java.util.Vector;

public class Deptor {
	
	private String name;
	private Vector<Dept> depts;
	
	public Deptor(String name, Vector<Dept> depts){
		this.name=name;
		this.depts=depts;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Vector<Dept> getDepts() {
		return depts;
	}
	
	public float getTotalDepts(){
		float amount=0;
		
		for(Dept dept : getDepts()){
			amount += dept.getAmount();
		}
		
		return amount;
	}
	
	public static float getTotalDepts(Vector<Deptor> deptors){
		float amount=0;
		
		for(Deptor deptor : deptors){
			amount += deptor.getTotalDepts();
		}
		
		return amount;
	}


}
